#include <material/editoreffectprogram.h>
#include <session.h>

EditorEffectProgram::EditorEffectProgram()
{
  CE_OBJECT_CONSTR
  _effectProgram = Session::Get()->GetDevice()->CreateEffectProgram();
  if (_effectProgram)
    {
      _effectProgram->AddRef();
    }
}

EditorEffectProgram::~EditorEffectProgram()
{
  CE_UNSET (_effectProgram);
}


iEffectProgram* EditorEffectProgram::GetSource()
{
  return _effectProgram;
}

void EditorEffectProgram::SetProgram(ceRenderPass pass, iProgram *program)
{
  _effectProgram->SetProgram(pass, program);
}

iProgram* EditorEffectProgram::GetProgram(ceRenderPass pass)
{
  return _effectProgram->GetProgram(pass);
}


void EditorEffectProgram::BeginPass(ceRenderPass pass)
{
  _effectProgram->BeginPass(pass);
}


void EditorEffectProgram::EndPass(ceRenderPass pass)
{
  _effectProgram->EndPass(pass);
}

void EditorEffectProgram::RegisterSemantic(ceProgramParameterBinding binding, const std::string &parameterName)
{
  _effectProgram->RegisterSemantic(binding, parameterName);
}

void EditorEffectProgram::RegisterSemantic(const ceProgramParameterName &name, const std::string &parameterName)
{
  _effectProgram->RegisterSemantic(name, parameterName);
}

iProgramParameter* EditorEffectProgram::GetParameter(ceProgramParameterBinding binding)
{
  return _effectProgram->GetParameter(binding);
}

iProgramParameter* EditorEffectProgram::GetParameter(const ceProgramParameterName &name)
{
  return _effectProgram->GetParameter(name);
}
